<%@language=vbscript%>
<% 
	Session("FormName")="F19"
	Session("VanBan")=""
%>
<!--#include file="..\CheckSession.inc"-->
<!--#include file=..\getFormName.inc-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="vi">
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<!--#include file="..\jvGrid.inc"-->
<!--#include file="..\RootContent.inc"-->
<!--#include file="..\pageSelected.inc"-->
<%	
	'bg thphuc 25/02/03
	if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("IsAdmin") then
		bhienthi="1"
	end if
	'ed thphuc 25/02/03
	bComm=Request("bComm")	
	bNam=Request("bNam")
	bImgAttach="../Images/attach.gif"

' HienSX	
	sort=request("sort")
	if sort="" then sort="RevDate"
	Select case sort
		Case "Date":
			oSQL=" order by ngaynhan,len(soghinhan),soghinhan"
			bImgDate="../Images/up.gif"
			bImgNum=""
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend=""
		Case "RevDate":
			oSQL=" order by ngaynhan DESC,len(soghinhan) DESC,soghinhan DESC"
			bImgDate="../Images/down.gif"
			bImgNum=""
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend=""
		Case "Num":
			oSQL=" order by soghinhan,ngaynhan"
			bImgDate=""
			bImgNum="../Images/up.gif"
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend=""
		Case "RevNum":
			oSQL=" order by soghinhan DESC,ngaynhan DESC"
			bImgDate=""
			bImgNum="../Images/down.gif"
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend=""
		Case "Symbol":
			oSQL=" order by sogoc,ngaynhan,soghinhan"
			bImgDate=""
			bImgNum=""
			bImgSymbol="../Images/up.gif"
			bImgSubject=""
			bImgPlaceSend=""
		Case "RevSymbol":
			oSQL=" order by sogoc DESC,ngaynhan DESC,soghinhan DESC"
			bImgDate=""
			bImgNum=""
			bImgSymbol="../Images/down.gif"
			bImgSubject=""
			bImgPlaceSend=""
		Case "Subject":
			oSQL=" order by Trichyeu,ngaynhan,soghinhan"
			bImgDate=""
			bImgNum=""
			bImgSymbol=""
			bImgSubject="../Images/up.gif"
			bImgPlaceSend=""
		Case "RevSubject":
			oSQL=" order by Trichyeu DESC,ngaynhan DESC,soghinhan DESC"
			bImgDate=""
			bImgNum=""
			bImgSymbol=""
			bImgSubject="../Images/down.gif"
			bImgPlaceSend=""
		Case "PlaceSend":
			oSQL=" order by doitac,ngaynhan,soghinhan"
			bImgDate=""
			bImgNum=""
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend="../Images/up.gif"
		Case "RevPlaceSend":
			oSQL=" order by doitac DESC,ngaynhan DESC,soghinhan DESC"
			bImgDate=""
			bImgNum=""
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend="../Images/down.gif"
		Case "Attach":
			oSQL=" order by attach"
			bImgDate=""
			bImgNum=""
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend=""
		Case "RevAttach":
			oSQL=" order by attach DESC"
			bImgDate=""
			bImgNum=""
			bImgSymbol=""
			bImgSubject=""
			bImgPlaceSend=""
	End Select

	if Request("bFlowok")="ok" then
		bIDFlow=Request("IDFlow")
		sSQL="Update workflow set Tam=0 where maworkflow like '"& bIDFlow &"'"
		Conn.Execute sSQL
	end if
	if Request("bFlowloaibo")="ok" then
		on error resume next
		Conn.BeginTrans
					
		bIDFlow=Request("IDFlow")
		sSQL="Delete from workflow where maworkflow like '"& bIDFlow &"'"
		Conn.Execute sSQL
		sSQL="Delete from flownode where maworkflow like '"& bIDFlow &"'"
		Conn.Execute sSQL
		if Err.number=0 then
			Conn.CommitTrans
		else
			Conn.RollbackTrans
		end if
	end if

	Select case bComm
		case "delete"
			if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("IsAdmin") then 
				bSogoc=request("TxtSogoc")
				bSoghinhan=request("TxtSoghinhan")
				bID=Request("TxtID")
				'Kiem tra xoa lien quan den muontratailieu
				sSQL="Select * from muontra where Trangthaimuon=1 and loaitailieu like '1' and  matailieu like '"& modistring(bID) &"'"
				Set RecKTMuon=server.CreateObject("ADODB.Recordset")
				RecKTMuon.CursorType=3
				RecKTMuon.CacheSize=5
				RecKTMuon.Open sSQL,Conn
				bNotDel=false
				if RecKTMuon.RecordCount then
					bNotDel=true
				end if
				RecKTMuon.Close
				Set RecKTMuon=nothing
				'Bat dau xoa			
				'Tao Transaction
				if not bNotDel then
				On Error resume next
				Conn.BeginTrans
				sSQL="Delete ykxl_hxl where IDVTDEN like '"& modistring(bID) &"'"
				Conn.Execute sSQL
				sSQL="Delete hoanthanhxl where IDVTDEN like '"& modistring(bID) &"'"
				Conn.Execute sSQL
				sSQL="Delete from VTDen where ID like '"& modistring(bID) &"'"
				bTentep=Request("TxtTentep")
				Conn.Execute sSQL
				sSQL="Delete from Quyen where Mavanthu like '"& modistring(bID) &"' and maLoaivanthu like '1'"
				Conn.Execute sSQL
				sSQL="Delete from vanban_vuviec where Mavanban like '"& modistring(bID) &"' and Loaivanban like '1'"
				Conn.Execute sSQL
				sSQL="Select * from vanban_Noidung where Mavanthu like '"& modistring(bID) &"' and Loaivanthu like '1'"
				set RecNoidung=server.CreateObject("ADODB.Recordset")
				RecNoidung.CursorType=3
				RecNoidung.CacheSize=5
				RecNoidung.Open sSQL,Conn
				Set File = Server.CreateObject("ActiveFile.File")
				do while not RecNoidung.EOF
					File.Name=RootContent & "Upload\"& cstr(bNam) &"\den\"& RecNoidung("Tentep")
					if File.Exists() then
						File.Delete()
					end if
					RecNoidung.MoveNext
					if Err.number<>0 then
						exit Do
					end if
				Loop			
				'Xoa bang vanban_noidung
				sSQL="Delete from vanban_Noidung where Mavanthu like '"& modistring(bID) &"' and Loaivanthu like '1'"
				Conn.Execute sSQL	
				File.Name=RootContent & "Upload\"& cstr(bNam) &"\den\TEXT\"& bID & ".VT"
				if File.Exists() then
					File.Delete()
				end if
				set File=nothing
				'Ket Thuc Trasaction
				if Err.number=0 then
					Conn.CommitTrans				
					bTrangthai=1				
				else
					bTrangthai=0
					Conn.RollbackTrans
				end if
				'Ghi nhan Ai da login thanh cong
				bHoten=Session("bHoten")
				bNgaygio=cstr(Date()) &" "& cstr(Time())
				bChucnang="C&#7853;p nh&#7853;t V&#259;n th&#432; &#273;&#7871;n"
				bIDTailieu=bSoghinhan
				bDongtac="Xo&#225;"
				sSQL="insert into loguser(Tennguoisudung,ngaygio,chucnangdung,dongtac,IDTailieu,Trangthai) Values('"& bHoten _
					&"','"& bNgaygio &"','"& bChucnang &"','"& bDongtac &"','"& bIDTailieu &"','"& bTrangthai &"')"
				Conn.Execute sSQL							
				else
					bMsg="M&#227; v&#259;n th&#432; &#273;ang &#273;&#432;&#7907;c li&#234;n k&#7871;t kh&#244;ng th&#7875; xo&#225; &#273;&#432;&#7907;c"
				end if	
		btcu="SELECT Quyen_Nhom.Mavanthu FROM Canbo INNER JOIN Canbo_Nhom ON Canbo.Macanbo =Canbo_Nhom.Macanbo INNER JOIN Nhom ON dbo.Canbo_Nhom.Manhom=Nhom.Manhom INNER JOIN Quyen_Nhom ON Nhom.Manhom =Quyen_Nhom.MaNhom WHERE (Canbo.Macanbo = '"& Session("bMaCB") &"') and Quyen_nhom.maloaivanthu like '1'"
		'if bvanphongbo=true or Session("IsAdmin") then
		if Session("IsAdmin") then
				if session("sSQLDen")="" then
					sSQL="Select " & Session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTden.ngaynhan>='"& Session("Year") &"' " & oSQL

					bPrintValue="Select " & Session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTden.ngaynhan>='"& Session("Year") &"' "
				else
					bPrintValue=session("sSQLDen")
					sSQL=session("sSQLDen") & " "& oSQL
				end if
		else
			if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),2)="1" then
				if session("sSQLDen")="" then
					sSQL="Select " & Session("TopNum") & " VTDen.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTDen.ngaynhan>='"& Session("Year") &"' "& oSQL

					bPrintValue="Select " & Session("TopNum") & " VTDen.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTDen.ngaynhan>='"& Session("Year") &"' "
				else
					bPrintValue=session("sSQLDen")
					sSQL=session("sSQLDen") & " "& oSQL
				end if
			else
			
				if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),9)="1" then
					'bg thphuc 10/02/03
					bt="SELECT Quyen_Nhom.Mavanthu FROM donvi inner join quyen_nhom on donvi.id = quyen_nhom.manhom where donvi.madonvi like '"& Session("bMaDonVi") &"' and Quyen_nhom.maloaivanthu like '1'"
					if session("sSQLDen")="" then
						sSQL="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and donvixuly like '%"& Session("bMaDonVi") &"%') or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID in ("& bt &") or (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1'))))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "& oSQL
						
						bPrintValue="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and donvixuly like '%"& Session("bMaDonVi") &"%') or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID in ("& bt &") or (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1'))))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & " "& oSQL
					end if
					'ed thphuc 10/02/03
				else
					'bg thphuc 18/02/03
					bt="SELECT Quyen_Nhom.Mavanthu FROM donvi inner join quyen_nhom on donvi.id = quyen_nhom.manhom where donvi.madonvi like '"& Session("bMaDonVi") &"' and Quyen_nhom.maloaivanthu like '1'"
					'ed thphuc 18/02/03
					if session("sSQLDen")="" then
						sSQL="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1')))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "& oSQL	

						bPrintValue="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1')))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & " "& oSQL
					end if
				end if
			end if
		end if			
	end if
		case "search"
			bSogoc=trim(request("TxtSogoc"))
			bID=trim(request("TxtID"))
			bTukhoa=trim(Request("TxtTukhoa"))
			bTungay=trim(Request("TxtTungay"))
			bDenngay=trim(Request("TxtDenNgay"))
			bTrichyeu=trim(Request("TxtTrichyeu"))
			if bTrichyeu="" and bTukhoa="" and bSogoc="" and bID="" then
				if bTungay=bDenngay then
					bNgayIn=bTungay
				end if
			end if
			bt="SELECT Quyen_Nhom.Mavanthu FROM Canbo INNER JOIN Canbo_Nhom ON Canbo.Macanbo =Canbo_Nhom.Macanbo INNER JOIN Nhom ON dbo.Canbo_Nhom.Manhom=Nhom.Manhom INNER JOIN Quyen_Nhom ON Nhom.Manhom =Quyen_Nhom.MaNhom WHERE (Canbo.Macanbo = '"& Session("bMaCB") &"') and Quyen_nhom.maloaivanthu like '1'"
			if (bTungay<>"" and bDenNgay<>"") then
				if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),2)="1" or Session("IsAdmin") then
					if session("sSQLDen")="" then
						sSQL="Select "& session("TopNum") & " * from VTDen where Sogoc like '%"& Modistring(bSogoc) &"%'"
						sSQL=sSQL+" And Tukhoa Like '%"& Modistring(bTukhoa) &"%'"
						sSQL=sSQL+" And Trichyeu Like '%"& Modistring(bTrichyeu) &"%'"
						sSQL=sSQL+" And ( Ngaynhan Between '"& SaveDate(bTungay) &"' And '"& SaveDate(bDenngay) &"') and ngaynhan>='"& Session("Year") &"'" & oSQL
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & oSQL
					end if
				else
					if session("sSQLDen")="" then
						sSQL="SELECT "& session("TopNum") & " VTden.* FROM VTden WHERE ((VTden.Congcong=1) or  (VTden.Congcong=0 and ((VTden.ID in ("& bt &")) or (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1'))))) and trangthaiduyet=1 "
						sSQL=SSQL+" And Sogoc like '%"& Modistring(bSogoc) &"%'"
						sSQL=sSQL+" And Tukhoa Like '%"& Modistring(bTukhoa) &"%'"
						sSQL=sSQL+" And Trichyeu Like '%"& Modistring(bTrichyeu) &"%'"
						sSQL=sSQL+" And ( ngaynhan Between '"& SaveDate(bTungay) &"' And '"& SaveDate(bDenngay) &"') and ngaynhan>='"& Session("Year") &"'" & oSQL
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & oSQL
					end if
				end if
			else
				if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),2)="1" or Session("IsAdmin") then
					if session("sSQLDen")="" then
						sSQL="Select "& session("TopNum") & " * from VTDen where Sogoc like '%"& Modistring(bSogoc) &"%'"
						sSQL=sSQL+" And Tukhoa Like '%"& Modistring(bTukhoa) &"%'"
						sSQL=sSQL+" And Trichyeu Like '%"& Modistring(bTrichyeu) &"%' and ngaynhan>='"& Session("Year") &"'" & oSQL
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & oSQL
					end if
				else
					if session("sSQLDen")="" then
						sSQL="SELECT "& session("TopNum") & " VTden.* FROM VTden WHERE ((VTden.Congcong=1) or  (VTden.Congcong=0 and ((VTden.ID in ("& bt &")) or (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1'))))) and trangthaiduyet=1 "
						sSQL=sSQL+" And Sogoc like '%"& Modistring(bSogoc) &"%'"
						sSQL=sSQL+" And Tukhoa Like '%"& Modistring(bTukhoa) &"%'"
						sSQL=sSQL+" And Trichyeu Like '%"& Modistring(bTrichyeu) &"%' and ngaynhan>='"& Session("Year") &"'" & oSQL
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & oSQL
					end if
				end if
			end if			
			%>
			<!--#include file="funcSearch.inc"-->
			<%
		Case else
		btcu="SELECT Quyen_Nhom.Mavanthu FROM Canbo INNER JOIN Canbo_Nhom ON Canbo.Macanbo =Canbo_Nhom.Macanbo INNER JOIN Nhom ON dbo.Canbo_Nhom.Manhom=Nhom.Manhom INNER JOIN Quyen_Nhom ON Nhom.Manhom =Quyen_Nhom.MaNhom WHERE (Canbo.Macanbo = '"& Session("bMaCB") &"') and Quyen_nhom.maloaivanthu like '1'"
		'if bvanphongbo=true or Session("IsAdmin") then
		if Session("IsAdmin") then
				if session("sSQLDen")="" then
					sSQL="Select " & Session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTden.ngaynhan>='"& Session("Year") &"' " & oSQL

					bPrintValue="Select " & Session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTden.ngaynhan>='"& Session("Year") &"' "
				else
					bPrintValue=session("sSQLDen")
					sSQL=session("sSQLDen") & " "& oSQL
				end if
		else
			if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),2)="1" then
				if session("sSQLDen")="" then
					sSQL="Select " & Session("TopNum") & " VTDen.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTDen.ngaynhan>='"& Session("Year") &"' "& oSQL

					bPrintValue="Select " & Session("TopNum") & " VTDen.*,hoanthanhxl.ngayhtxl from VTDen left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' where VTDen.ngaynhan>='"& Session("Year") &"' "
				else
					bPrintValue=session("sSQLDen")
					sSQL=session("sSQLDen") & " "& oSQL
				end if
			else
			
				if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),9)="1" then
					'bg thphuc 10/02/03
					bt="SELECT Quyen_Nhom.Mavanthu FROM donvi inner join quyen_nhom on donvi.id = quyen_nhom.manhom where donvi.madonvi like '"& Session("bMaDonVi") &"' and Quyen_nhom.maloaivanthu like '1'"
					if session("sSQLDen")="" then
						sSQL="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and donvixuly like '%"& Session("bMaDonVi") &"%') or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID in ("& bt &") or (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1'))))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "& oSQL
						
						bPrintValue="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and donvixuly like '%"& Session("bMaDonVi") &"%') or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID in ("& bt &") or (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1'))))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & " "& oSQL
					end if
					'ed thphuc 10/02/03
				else
					'bg thphuc 18/02/03
					bt="SELECT Quyen_Nhom.Mavanthu FROM donvi inner join quyen_nhom on donvi.id = quyen_nhom.manhom where donvi.madonvi like '"& Session("bMaDonVi") &"' and Quyen_nhom.maloaivanthu like '1'"
					'ed thphuc 18/02/03
					if session("sSQLDen")="" then
						sSQL="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1')))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "& oSQL	

						bPrintValue="SELECT "& session("TopNum") & " VTden.*,hoanthanhxl.ngayhtxl FROM VTden left outer join hoanthanhxl on VTden.id=hoanthanhxl.idvtden and hoanthanhxl.madonvi='"& Session("bMaDonVi") &"' WHERE ((VTden.Congcong=1) or (VTden.Congcong=0 and VTden.ID in ("& btcu &")) or (VTden.Congcong=0 and (VTden.ID  in (Select mavanthu from Quyen where macanbo='"& Session("bMaCB") &"'  and maloaivanthu='1')))) and trangthaiduyet=1 and ngaynhan>='"& Session("Year") &"' "
					else
						bPrintValue=session("sSQLDen")
						sSQL=session("sSQLDen") & " "& oSQL
					end if
				end if
			end if
		end if			
	end select
	Set Rec=server.CreateObject("ADODB.Recordset")
	Rec.CursorType=3
	Rec.CacheSize=5
'	Rec.Open ssql,Conn	
'	response.write ssql
	Dim nRecCount	' Number of records found
	Dim nPageCount	' Number of pages of records we have
	Dim nPage	' Current page number
	sPage=request("Page")
	nPage=CLng(sPage)
	if nPage="" then 
		nPage=1
	end if
	if sPage<>"" then
		Session("pagevtden")=nPage
	else
		nPage=Session("pagevtden")
	end if
	rec.Open ssql,Conn
	if  rec.EOF and rec.BOF then
		nPageCount=0
	end if	
	bDisplay=Request("bDisplay")
	if  bDisplay then
		sSQL="Select VTDen.* from VTDen where ID like "& request("bID")
		Set RecDisplay=Server.CreateObject("ADODB.Recordset")
		RecDisplay.CursorType=3
		RecDisplay.CacheSize=5
		RecDisplay.Open sSQL,Conn
		if RecDisplay.RecordCount>0 then
			bSogoc=RecDisplay("Sogoc")
			bSoghinhan=RecDisplay("Soghinhan")
			bID=RecDisplay("ID")
			bNgayKy=RecDisplay("Ngayky")
			bngaynhan=RecDisplay("Ngaynhan")

			bTukhoa=RecDisplay("Tukhoa")
			bTrichyeu=RecDisplay("TRichyeu")
			bDuyet=RecDisplay("Trangthaiduyet")
			bChophep=RecDisplay("Congcong")
			Session("bTenVB")=RecDisplay("Trichyeu")
			bmasotc=RecDisplay("masotc")
			if isnull(bmasotc) Then
				bmasotc=""
			end if
			sSQL="Select tentep from vanban_noidung where mavanthu like '"& bID &"' and Loaivanthu='1' order by Sothutu "
			Set RecVBND=server.CreateObject("ADODB.recordset")
			RecVBND.CursorType=3
			RecVBND.CacheSize=5
			RecVBND.Open sSQL,Conn
			if RecVBND.RecordCount>0 then
				bTenTep=RecVBND("tentep")
			end if			
			'bTenTep=RecDisplay("Tentep")
		end if
		RecDisplay.Close
		set RecDisplay=nothing
			
		' Kiem tra quyen R/W/F
		if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("IsAdmin") then
			bQuyen="F"
		else
			sSQL="Select * from Quyen Where Mavanthu like '"& bID &"' and Macanbo like '"& Session("bMaCB") &"' and maloaivanthu like '1'"
			Set RecKTQ=server.CreateObject("ADODB.Recordset")
			RecKTQ.CursorType=3
			RecKTQ.CacheSize=5
			RecKTQ.Open sSQL,Conn
			if RecKTQ.RecordCount>0 then
				bQuyen=RecKTQ("Quyen")
			end if
			RecKTQ.Close
			set RecKTQ=nothing
		end if
	end if
%>	
<%	if request("chuachon")="thongtin" then%>
		<p align=center><font color=red>B&#7841;n c&#7847;n ch&#7885;n &#273;&#250;ng th&#244;ng tin c&#7847;n s&#7917;a</font></p>
<%	end if%>
<!--#include file="..\jvfunction.inc"-->
<script language=VBScript runat=server>
	' H&#224;m &#273;&#7883;nh d&#7841;ng l&#7841;i ng&#224;y M/D/Y-> D/M/Y
	Function FormatDate(vDate)
	   If Not IsNull(vDate) Then
	        vM = Right("0" & Month(vDate), 2)
	        vD = Right("0" & Day(vDate), 2)
	        vY = Right("19" & Year(vDate), 4)
	        FormatDate = vD & "/" & vM & "/" & vY
	   End If
	End Function
	Function ModiString(mess_s)
		message = Replace("" & mess_s,"'", "''")
		ModiString=message
	End function
	Function SaveDate(vDate)
		dim bvitri1
		dim bvitri2
	   vDate=trim(cstr(vDate))
	   bvitri1=instr(1,vDate,"/")
	   bMonth=left(vDate,bvitri1-1)
	   bvitri2=instr(bvitri1+1,vDate,"/")
	   Dim Temp
	   Temp=right(vDate,len(vDate)-bvitri1)
	   bDay=left(Temp,bvitri2-bvitri1-1)
	   bYear=right(vDate,len(vDate)-bvitri2)
       SaveDate=bDay+"/"+bMonth+"/"+bYear
	End Function
</script>
<script language=javascript>
	function OpenW(bCom){
//HienSX
		sort=Noidung.Sort.value;
		if(bCom=="print"){
			remote = window.open('frmsearchDEN.asp?sort='+sort+'&bComm=VTDEN&print=OK','new_page','width=600,height=225').focus();
		}
		else{
			remote = window.open('frmsearchDEN.asp?sort='+sort+'&bComm=VTDEN','new_page','width=600,height=225').focus();
		}
	}
</script>
	
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
//HienSX
function Sort(SortKey){
	if (document.Noidung.Sort.value.indexOf(SortKey)== -1)
		document.Noidung.Sort.value=SortKey;
	else {
		if (document.Noidung.Sort.value.indexOf('Rev')== -1)
			document.Noidung.Sort.value='Rev' + SortKey;
		else
			document.Noidung.Sort.value= SortKey;
	}
	Noidung.target="right"
	Noidung.action="frmdsvtden.asp?sort=" + Noidung.Sort.value;
	Noidung.submit();
}
function SetFocus(){
	window.Noidung.CmdSearch.focus();
}

function ChangePage(){
	strURL= Noidung.page.value;
	window.Noidung.target="right";
	window.Noidung.action = strURL;
	window.Noidung.submit();
}

function CmdAdd_onclick() {
	window.Noidung.target="right";
//HienSX
	window.Noidung.action="frmvtden.asp?bComm=add&sort="+Noidung.Sort.value;
	window.Noidung.submit();
}

function CmdEdit_onclick() {
	if (Noidung.TxtSogoc.value==""){
		alert("Cho biết thông tin cần sửa");
		return false;
	}
	Noidung.TxtSogoc.disabled=false
	Noidung.TxtTrichyeu.disabled=false
	Noidung.TxtTuKhoa.disabled=false
	window.Noidung.target="right";
//HienSX
	window.Noidung.action="frmvtden.asp?bComm=edit&sort="+Noidung.Sort.value;
	window.Noidung.submit();
}

function CmdPrint_onclick() {
	if(trim(Noidung.PrintValue.value)!=""){
		Noidung.target="_blank";
		Noidung.action="frmprintden.asp";
		Noidung.submit();
	}
/*
	else{
		OpenW("print");
	}
	return
	if (Noidung.TxtTungay.disabled){
		<%if Request("bfromflow")<>"ok" then%>
			Noidung.CmdDangkyVV.disabled=true;
			Noidung.CmdDelete.disabled=true;
			Noidung.CmdEdit.disabled=true;
			Noidung.CmdEmail.disabled=true;
			Noidung.CmdNoidung.disabled=true;
			Noidung.Cmdworkflow.disabled=true;
			Noidung.CmdSearch.disabled=true;
		<%end if%>
		Noidung.TxtSogoc.disabled=true;
		Noidung.TxtDenngay.disabled=false;
		Noidung.TxtTuKhoa.disabled=true;
		Noidung.TxtTungay.disabled=false;
		Noidung.TxtTrichyeu.disabled=true;
		Noidung.TxtSogoc.value="";
		Noidung.TxtDenngay.value="";
		Noidung.TxtTuKhoa.value="";
		Noidung.TxtTungay.value="";
		Noidung.TxtTrichyeu.value="";
			
		Noidung.TxtTungay.focus();
		return false;
	}
	if(trim(Noidung.TxtTungay.value)!=""){
		if (!isDate(Noidung.TxtTungay.value)){
			alert("Ngày không hợp lệ");
			Noidung.TxtTungay.focus();
			return false;
		}
		else{
			if(trim(Noidung.TxtDenngay.value)==""){
				alert("Cho biết đến ngày");
				Noidung.TxtDenngay.focus();
				return false;
			}
		}
	}
	if(Noidung.TxtDenngay.value!=""){	
		if (!isDate(Noidung.TxtDenngay.value)){
			alert("Ngày không hợp lệ");
			Noidung.TxtDenngay.focus();
			return false;
		}
		else{
			if(trim(Noidung.TxtTungay.value)==""){
				alert("Cho biết từ ngày");
				Noidung.TxtTungay.focus();
				return false;
			}
		}
	}
	Noidung.TxtSogoc.disabled=true
	Noidung.TxtTrichyeu.disabled=true
	Noidung.TxtTuKhoa.disabled=true	
	Noidung.CmdSearch.disabled=false;
	Noidung.target="_blank";
	Noidung.action="frmprintden.asp";
	Noidung.submit();
	Noidung.TxtDenngay.disabled=true;
	Noidung.TxtTungay.disabled=true;
*/
}
function CmdSearch_onclick() {
	OpenW("");
	return;
	if (Noidung.TxtSogoc.disabled){
		<%if Request("bfromflow")<>"ok" then%>
			Noidung.CmdDangkyVV.disabled=true;
			Noidung.CmdDelete.disabled=true;
			Noidung.CmdEdit.disabled=true;
			Noidung.CmdEmail.disabled=true;
			Noidung.CmdNoidung.disabled=true;
			Noidung.Cmdworkflow.disabled=true;
			Noidung.CmdPrint.disabled=true;
		<%end if%>
		//Noidung.Cmdworkflow.disabled=true;
		Noidung.CmdSearch.value="Tì<u>m</u>";
		Noidung.TxtSogoc.disabled=false;
		Noidung.TxtDenngay.disabled=false;
		Noidung.TxtTuKhoa.disabled=false;
		Noidung.TxtTungay.disabled=false;
		Noidung.TxtTrichyeu.disabled=false;
		Noidung.TxtSogoc.value="";
		//Noidung.TxtDenngay.value="<%=Formatdate(Date())%>";
		Noidung.TxtDenngay.value="";
		Noidung.TxtTuKhoa.value="";
		//Noidung.TxtTungay.value="<%=Formatdate(Date()-90)%>";
		Noidung.TxtTungay.value="";
		Noidung.TxtTrichyeu.value="";
			
		Noidung.TxtSogoc.focus();
		return false;
	}
	if(trim(Noidung.TxtTungay.value)!=""){
		if (!isDate(Noidung.TxtTungay.value)){
			alert("Ngày không hợp lệ");
			Noidung.TxtTungay.focus();
			return false;
		}
		else{
			if(trim(Noidung.TxtDenngay.value)==""){
				alert("Cho biết đến ngày nào");
				Noidung.TxtDenngay.focus();
				return false;
			}
		}
	}
	if(Noidung.TxtDenngay.value!=""){	
		if (!isDate(Noidung.TxtDenngay.value)){
			alert("Ngày không hợp lệ");
			Noidung.TxtDenngay.focus();
			return false;
		}
		else{
			if(trim(Noidung.TxtTungay.value)==""){
				alert("Cho biết từ ngày nào");
				Noidung.TxtTungay.focus();
				return false;
			}
		}
	}
	bsg=Noidung.TxtSogoc.value;
	btn=Noidung.TxtTungay.value;
	bdn=Noidung.TxtDenngay.value;
	bty=Noidung.TxtTrichyeu.value;
	btk=Noidung.TxtTuKhoa.value;
	window.Noidung.target="right"
	<% if request("bfromflow")="ok" then%>
		window.Noidung.action="frmdsvtden.asp?bfromflow=ok&bComm=search";
	<%else%>
		window.Noidung.action="frmdsvtden.asp?bComm=search";
	<%end if%>
	window.Noidung.submit();
}
function Row_Click(Sogoc,Tukhoa,Tungay,Trichyeu,Tentep,soghinhan){
	document.Noidung.TxtSogoc.value=Sogoc;
	document.Noidung.TxtTuKhoa.value=Tukhoa;
	document.Noidung.TxtTungay.value=Tungay;
	document.Noidung.TxtDenngay.value=Tungay;
	document.Noidung.TxtTrichyeu.value=Trichyeu;
	document.Noidung.TxtTentep.value=Tentep;
	document.Noidung.TxtSoghinhan.value=soghinhan;
	//document.Noidung.TxtID.value=soghinhan;
}
function CmdNoidung_onclick() {
	if (Noidung.TxtID.value!=""){
		window.Noidung.target="right";
		//bg thphuc 13/02/03
		window.Noidung.action="duyetcanbodvxl.asp?bstepduyet=0&MaVT="+"<%=bID%>"+"&bMaLoaiVT=1";
		//ed thphuc 13/02/03
		window.Noidung.submit();
	}
	else{
		alert("Chá»n vÄƒn thÆ° cáº§n xem");
	}
		
		
}
function CmdDelete_onclick() {	
	if (trim(Noidung.TxtSogoc.value)!=""){
		if(!confirm("Bạn có muốn xóa không ?")){
			return false;	
		}
		window.Noidung.target="right"
		window.Noidung.action="frmdsvtden.asp?page="+"<%=nPage%>"+"&bComm=delete"+"&bnam="+"<%=bnam%>";
		window.Noidung.submit();
	}
	else{
		alert("Bạn hãy chọn thông tin cần xóa");
	}
}
function CmdNoidungtep_onclick() {
	if(Noidung.TxtSoghinhan.value==""){
		alert("Ch&#7885;n v&#259;n th&#432;");
		return false;
	}
	<%if bQuyen="" or bQuyen="R" then%>
		alert("B&#7841;n kh&#244;ng c&#243; quy&#7873;n thay &#273;&#7893;i n&#7897;i dung &#273;&#7889;i v&#7899;i v&#259;n th&#432; n&#224;y");
		return false;
	<%end if%>
	window.Noidung.target="right"
	window.Noidung.action="upload.asp?filename="+Noidung.TxtTentep.value;
	window.Noidung.submit();
}

function Noidung_onclick() {

}
function CmdDangkyVV_onclick() {
	<%if bDisplay then%>
		<%if not bDuyet then%>
			alert("Văn thư này chưa được duyệt nên không thể đăng ký!");
			return false;
		<%end if%>
		window.Noidung.target="right";
		parent.vbalFrameset.cols = "0,6,*";
		window.Noidung.action="dangkyvuviec/frmdangky.asp?LoaiVt=1&sort=" +Noidung.Sort.value;
		window.Noidung.submit();
		/*showModalDialog("addvtdivuviec.asp?bMa="+"<%=bID%>",window,"status:false;dialogWidth:26em;dialogHeight:15em;Center:Yes;Help:No;Resizable:No;Status:No;")
		wDKVV = window.open('addvtdenvuviec.asp?bMa=<%=bID%>','page_dkvv','width=420,height=192,left=200,top=200').focus();*/
	<%else%>
		alert("H&#227;y ch&#7885;n v&#259;n th&#432; c&#7847;n &#273;&#259;ng k&#253;");
	<%end if%>

}
function Cmdworkflow_onclick() {
	if (Noidung.TxtSogoc.value==""){
		alert("B&#7841;n h&#227;y ch&#7885;n v&#259;n th&#432; c&#7847;n x&#7917; l&#253;");
		return false;
	}
	if(!confirm("Bạn có muốn tạo luồng xử lý ?")){
	  return false;
	}
	window.Noidung.target="right";
	window.Noidung.action="../workflow/createworkflow.asp?bComm=vtden";
	window.Noidung.submit();
}


function CmdBack_onclick() {
	Noidung.target="right";
	Noidung.action="../workflow/frmdsflow.asp";
	Noidung.submit();
}
function CmdEmail_onclick() {	
	Noidung.target="_blank";
	Noidung.TxtTrichyeu.disabled=false;
	Noidung.action="compose.asp?bLoaiVt=1&bMa="+"<%=bID%>"+"&bNam="+"<%=bNam%>";
	Noidung.submit();
}

function CmdYKXL_onclick() {
	//wYKXL = window.showModalDialog('frmYkienxuly.asp?bID=<%=bID%>','',"dialogWidth:30em; dialogHeight:11em; center: Yes; help: No; resizable: No; status: No;");


	//wYKXL = window.open('frmYkienxuly.asp?bID=<%=bID%>','page_YKXL','width=400,height=210').focus();

	window.Noidung.target="right"
	window.Noidung.action="frmYkienxuly.asp?bID="+"<%=bID%>"
	window.Noidung.submit()

}
function CmdHTXL_onclick(){
	txtid=Noidung.TxtID.value;
	remote = window.open('frmhtxl.asp?IDVTDEN='+txtid,'pageHTXL','width=300,height=160,top=180,left=250').focus();
}
function Open(){
	//popupWin = window.open('open.asp','new_page','width=300,height=300');
	remote = window.showModalDialog('open.asp','','dialogWidth:20em; dialogHeight:21em');

}
//-->
</SCRIPT>
<%if bMsg<>"" then%>
	<p align=center><font color=red><%=bMsg%></p>
<%end if%>
<LINK href="../styles/styles.css" type=text/css rel=STYLESHEET>
<body bgcolor=#F8F9D9 leftmargin=2 topmargin=0 style="font-family:times new roman" onload="SetFocus()">
<form name="Noidung" method="post">
<!-- HienSX -->
<Input TYPE="hidden" name="Sort" value="<%=sort%>">
<INPUT TYPE="hidden" name=PrintValue value="<%=bPrintValue%>">
<INPUT TYPE="hidden" name=btungay value="<%=btungay%>">
<INPUT TYPE="hidden" name=bdenngay value="<%=bdenngay%>">
<INPUT TYPE="hidden" name=NgayIn value="<%=bNgayIn%>">
<!-- Form nhap lieu -->
  <table border="0" width="100%" bgcolor="#BDD5D0" style="Font-family:Times New Roman;font-size:12pt;BORDER-BOTTOM-STYLE: none; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-TOP-STYLE: solid;border-collapse:collapse; border-left-color:#C0C0C0; border-right-color:#C0C0C0; border-top-color:#C0C0C0; border-bottom-color:#C0C0C0">
	<%if bDisplay then%>
		<Input type=hidden name=TxtTentep value='<%=bTentep%>'>
		<Input type=hidden name=TxtSoghinhan value='<%=bSoghinhan%>'>
		<Input type=hidden name=TxtID value='<%=bID%>'>
		<%Session("bMaVB")=bID%>
	<%else%>
		<Input type=hidden name=TxtTentep>
		<Input type=hidden name=TxtSoghinhan>
		<Input type=hidden name=TxtID>
	<%end if%>
    <tr>
      <TD WIDTH="100%" COLSPAN="6" BGCOLOR="#000080"><P ALIGN="CENTER"><FONT FACE="times new roman" COLOR="#FFFFFF" SIZE=3>CÔNG V&#258;N&nbsp; &#208;&#7870;N</FONT></P></TD>
    </tr>
    <tr>
      <td width="10%" align=center nowrap>Ký hiệu</td>
      <td width="28%" align="left">
		<%if bDisplay then%>
			<input type="text" name="TxtSogoc" value='<%=bSogoc%>' Disabled=true style="width:100%" size="20"></td>
		<%else%>
			<input type="text" name="TxtSogoc" Disabled=true style="width:100%"></td>
		<%end if%>
      <td width="12%" align="center" nowrap>T&#7915; ng&#224;y</td>
      <td width="20%">
		<%if bDisplay then%>
			<input type='text' name='TxtTungay' value='<%=FormatDate(bNgaynhan)%>' Disabled=true style="width:100%" size="20"></td>
		<%else%>
			<input type="text" name="TxtTungay" Disabled=true style="width:100%"></td>
		<%end if%>
      <td width="10%" align="center" nowrap>&#208;&#7871;n ng&#224;y</td>
      <td width="20%">
		<%if bDisplay then%>
			<input type="text" name="TxtDenngay" value='<%=FormatDate(bNgaynhan)%>' Disabled=true style="width:100%" size="20"></td>
		<%else%>
			<input type="text" name="TxtDenngay" Disabled=true style="width:100%"></td>
		<%end if%>
      </tr>
      <tr>
        <td width="10%" align="center" nowrap>T&#7915; kho&#225;</td>
        <td width="28%">
        <%if bDisplay then%>
			<input type="text" name="TxtTuKhoa" value='<%=bTukhoa%>' Disabled=true style="width:100%" size="20"></td>
		<%else%>
			<input type="text" name="TxtTuKhoa" Disabled=true style="width:100%"></td>
		<%end if%>
        <td width="12%" align="center">Tr&#237;ch y&#7871;u</td>
        <td width="50%" colspan="3">
        <%if bDisplay then%>
			<textarea name="TxtTrichyeu" Disabled=true style="font-family:Arial;width:100%" rows=1 cols=20><%=bTrichyeu%></textarea></td>
		<%else%>
			<textarea name="TxtTrichyeu" Disabled=true style="font-family:Arial;width:100%" rows=1 cols=20></textarea></td>
		<%end if%>
      </tr>
  </table>
<!-- Buttons -->
<%if request("bfromflow")="ok" then%>
	<table bgColor="#bdd5d0" cellspacing="1" width="100%" border="1" bordercolor="#111111">
	<tbody>
		<tr>
			<%if bDisplay then%>
				<% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),8)="1" or Session("IsAdmin") then %>
					<td width="34%"><Button language="javascript" name="Cmdworkflow" onclick="return Cmdworkflow_onclick()" style="height: 25; width: 100%;font-family:Arial" accesskey="A"><p>T<u>ạ</u>o luồng xử lý</p></Button></td>
				<%else%>
					<td width="34%"><Button language="javascript" disabled name="Cmdworkflow" onclick="return Cmdworkflow_onclick()" style="height: 25; width: 100%;font-family:Arial" accesskey="A"><p>T<u>ạ</u>o luồng xử lý</p></Button></td>
				<%end if%>
			<%else%>
				<td width="34%"><Button language="javascript" disabled name="Cmdworkflow" onclick="return Cmdworkflow_onclick()" style="height: 25; width:100%;font-family:Arial" accesskey="A"><p>T<u>ạ</u>o luồng xử lý</p></td>
			<%end if%>
			<td width="33%"><Button language="javascript" name="CmdSearch" onclick="return CmdSearch_onclick()" style="height: 25; width:100%;font-family:Arial" accesskey="M"><p>Tì<u>m</u> kiếm</p></td>
			<td width="33%"><Button name="CmdBack" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdBack_onclick()" accesskey="Q"><p>Qua<u>y</u> lại</p></td>
          </tr>
        </tbody>
      </table>
	<% else %>
	<table border=0 width="100%" bgcolor="#BDD5D0" cellspacing="0" cellpadding="0" style="Font-family:arial;font-size:10pt; BORDER-BOTTOM-STYLE: none; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-TOP-STYLE: solid;border-collapse:collapse; border-left-color:#C0C0C0; border-right-color:#C0C0C0; border-top-color:#C0C0C0; border-bottom-color:#C0C0C0">
  		<tr>
		 <td width="7%">
		   <% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("IsAdmin") then%>
   				<Button name="CmdAdd" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdAdd_onclick()" accesskey="T"><u>T</u>hêm</Button>
		   <% else %>   			
   				<Button name="CmdAdd" disabled=true style="height: 25; width: 100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdAdd_onclick()" accesskey="T"><u>T</u>hêm</Button>
		   <% end if%>   			
		</td>
   		<td width="7%">
		  <% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("IsAdmin") then	%>
			<%if bDisplay then%>
				<Button name="CmdEdit" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdEdit_onclick()" accesskey="S"><u>S</u>ửa</Button>
			<%else%>
				<Button name="CmdEdit" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdEdit_onclick()" disabled accesskey="S"><u>S</u>ửa</Button>
			<%end if%>
		  <%else%>
			<Button name="CmdEdit" disabled=true style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdEdit_onclick()" accesskey="S"><u>S</u>ửa</Button>
		  <%end if%>
		</td>
   		 <td width="7%">
		  <% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("IsAdmin") then	%>
   			<%if bDisplay then%>
   				<Button name="CmdDelete" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdDelete_onclick()" accesskey="X"><u>X</u>óa</Button>
   			<%else%>
   				<Button disabled name="CmdDelete" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdDelete_onclick()" accesskey="X"><u>X</u>óa</Button>
   			<%end if%>
   		  <% else%>
   			<Button name="CmdDelete" disabled=true style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdDelete_onclick()" accesskey="X"><u>X</u>óa</Button>
   		  <% end if%>
   		</td>
		<td width="12%">
		<% 'bg thphuc 25/02/03
		if bChophep or not(bDuyet) then%>
			<% if bChophep then%>
				<Button disabled name="CmdNoidung" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdNoidung_onclick()"><p>Công cộng</p></Button></td>
			<%else%>
				<Button disabled name="CmdNoidung" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdNoidung_onclick()" accesskey="P"><p><u>P</u>hân quyền</p></Button></td>
			<%end if%>
		<%else%>
			<%if bDisplay then%>
				<% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),9)="1" or Session("IsAdmin") then %>
					<Button name="CmdNoidung" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdNoidung_onclick()" accesskey="P"><p><u>P</u>hân quyền</p></Button></td>  
	   		  <% else%>
					<Button disabled name="CmdNoidung" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdNoidung_onclick()" accesskey="P"><p><u>P</u>hân quyền</p></Button></td>
	   		  <% end if%>
			<%else%>
				<Button disabled name="CmdNoidung" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdNoidung_onclick()" accesskey="P"><p><u>P</u>hân quyền</p></Button></td>
			<%end if%>
		<%end if
		'ed thphuc 25/02/03%>

  		<td width="12%">
		  <% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),"F24",1)="1" or Session("IsAdmin") then%>
   			<%if bDisplay then%>
				<Button name="CmdDangkyVV" style="height: 25; width: 100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdDangkyVV_onclick()" accesskey="D"><p><u>Đ</u>ăng ký VV</p></Button>
			<%else%>
				<Button disabled name="CmdDangkyVV" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdDangkyVV_onclick()" accesskey="D"><p><u>Đ</u>ăng ký VV</p></Button>
			<%end if%>
		  <%else%>
				<Button disabled=true name="CmdDangkyVV" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdDangkyVV_onclick()" accesskey="D"><p><u>Đ</u>ăng ký VV</p></Button>
		  <%end if%>
   		 </td>
   		 <td width="12%">
   			<%if bDisplay then%>
				<% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),8)="1" or Session("IsAdmin") then%>
					<Button name="Cmdworkflow" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return Cmdworkflow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng XL</p></Button>
				<%else%>  
					<Button disabled name="Cmdworkflow" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return Cmdworkflow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng XL</p></Button>
				<%end if%>
			<%else%>  
				<Button disabled name="Cmdworkflow" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return Cmdworkflow_onclick()" accesskey="a"><p>T<u>ạ</u>o luồng XL</p></Button>
			<%end if%>
   		 </td>
	   	 <td width="10%"><Button name="CmdSearch" style="height: 25; width: 100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdSearch_onclick()" accesskey="M"><p>Tì<u>m</u> kiếm</p></Button></td>
	   	 <td width="7%">
		 <% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),3)="1" or Session("IsAdmin") then	%>
				<Button name="CmdPrint" style="height: 25; width: 100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdPrint_onclick()" accesskey="I"><u>I</u>n</Button></td>
		<% else %>
				<Button disabled name="CmdPrint" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdPrint_onclick()" accesskey="I"><u>I</u>n</Button></td>
		<% end if %>

   		 <td width="7%">
			<% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),5)="1" or Session("IsAdmin") then%>
   				<%if bDisplay then%>
					<Button name="CmdEmail" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdEmail_onclick()" accesskey="E"><u>E</u>mail</Button>
				<%else%>
					<Button disabled name="CmdEmail" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdEmail_onclick()" accesskey="E"><u>E</u>mail</Button>
				<%end if%>
			<%else%>
				<Button disabled=true name="CmdEmail" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdEmail_onclick()" accesskey="E"><u>E</u>mail</Button>
			<%end if%>
   		 </td>
	   	 <td width="10%">
		<%if bmasotc="" then%>
			<Button name="CmdYKXL" disabled style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdYKXL_onclick()" accesskey="Y"><p><u>Ý</u> kiến XL</p></Button>
		<%else%>
			<%if not(bDuyet) then%>
				<Button name="CmdYKXL" disabled style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdYKXL_onclick()" accesskey="Y"><p><u>Ý</u> kiến XL</p></Button>
			<%else%>
				<% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),10)="1" or Session("IsAdmin") then	%>
					<%if bDisplay then%>
						<Button name="CmdYKXL" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdYKXL_onclick()" accesskey="Y"><p><u>Ý</u> kiến XL</p></Button>
					<%else%>
						<Button disabled name="CmdYKXL" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdYKXL_onclick()" accesskey="Y"><p><u>Ý</u> kiến XL</p></Button>
					<%end if%>
				<%else%>
					<Button disabled=true name="CmdYKXL" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdYKXL_onclick()" accesskey="Y"><p><u>Ý</u> kiến XL</p></Button>
				<%end if%>
			<%end if%>
		<%end if%>
   		 </td>	
	   	 <td width="10%">
	<%if bmasotc="" then%>
		<Button name="CmdHTXL" disabled style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdHTXL_onclick()" accesskey="H"><p><u>H</u>oàn thành XL</p></Button>
	<%else%>
 		<%if not(bDuyet) then%>
			<Button name="CmdHTXL" disabled style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdHTXL_onclick()" accesskey="H"><p><u>H</u>oàn thành XL</p></Button>
		<%else%>
			<% if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),13)="1" or Session("IsAdmin") then	%>
   				<%if bDisplay then%>
					<Button name="CmdHTXL" style="height: 25; width:100%;font-family:Arial" LANGUAGE=javascript onclick="return CmdHTXL_onclick()" accesskey="H"><p><u>H</u>oàn thành XL</p></Button>
				<%else%>
					<Button disabled name="CmdHTXL" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdHTXL_onclick()" accesskey="H"><p><u>H</u>oàn thành XL</p></Button>
				<%end if%>
			<%else%>
				<Button disabled=true name="CmdHTXL" style="height: 25; width:100%;font-family:Arial"  LANGUAGE=javascript onclick="return CmdHTXL_onclick()" accesskey="H"><p><u>H</u>oàn thành XL</p></Button>
			<%end if%>
		<%end if%>
	<%end if%>
		 </td>
   		 </tr>
	</table>	
<%end if%>
<!-- Danh sach cong van den -->
<table border="0" width="100%" style="Border-color:#C0C0C0; BORDER-BOTTOM-STYLE: solid; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-TOP-STYLE: solid">
		<tr bgcolor="#BDD5D0">
		<td width="4%" nowrap></td>
		<td width="1%" align="center"><A onmouseover="window.status='';return true" HREF="javascript:Sort('Attach')">&nbsp;<IMG border=0 SRC=../images/attach.gif>&nbsp;</A></td>
		
		<td width="10%" nowrap align="center"><A onmouseover="window.status='';return true" HREF="javascript:Sort('Num')"><b>Số đến</b>
		<% if bImgNum<>"" then %><IMG SRC="<%=bImgNum%>" BORDER=0><%end if%> </A></td>
        <td width="13%" nowrap><A onmouseover="window.status='';return true" HREF="javascript:Sort('Symbol')"><b>Số, ký hiệu</b>
		<% if bImgSymbol<>"" then %><IMG SRC="<%=bImgSymbol%>" BORDER=0><%end if%>
		</A></td>
		<td width="13%" nowrap align="center"><A onmouseover="window.status='';return true" HREF="javascript:Sort('Date')"><b>Ngày đến</b>&nbsp;
		<% if bImgDate<>"" then %><IMG SRC="<%=bImgDate%>" BORDER=0><%end if%> </A></td>
		<td width="35%" nowrap><A onmouseover="window.status='';return true" HREF="javascript:Sort('Subject')">&nbsp;&nbsp;<b>Tr&#237;ch y&#7871;u</b>&nbsp;&nbsp;&nbsp;
		<% if bImgSubject<>"" then %><IMG SRC="<%=bImgSubject%>" BORDER=0><%end if%>
		</A></td>
		<td width="25%" nowrap><A onmouseover="window.status='';return true" HREF="javascript:Sort('PlaceSend')">&nbsp;&nbsp;<b>Nơi gửi</b>&nbsp;&nbsp;&nbsp;<% if bImgPlaceSend<>"" then %><IMG SRC="<%=bImgPlaceSend%>" BORDER=0><%end if%></A></td>
		</tr>
   <% 
	If Not Rec.Eof Then
		nRecCount = Rec.RecordCount
		Rec.PageSize = 20
		nPageCount = Rec.PageCount
		If nPage < 1 then
			nPage = 1			
		End If
		if nPage > nPageCount Then
			nPage=nPageCount
		end if
		cnt=(pg-1)*pgsize + 1		    
		STT=1
		'rec.AbsolutePage=nPage
		rec.AbsolutePage=Session("pagevtden")
		howmanyrecs=0
		do while not Rec.EOF and howmanyrecs<rec.PageSize
			if (cnt/2=int(cnt/2)) then
				color="#eeeecc"
			else
				color="#F8F9D9"
			end if

			if rec("attach") then
				imagesAttach="<IMG border=0 SRC=../images/attach.gif>"
			else				
				imagesAttach=""
			end if
			ktmasotc=0
			ktmasotc=instr(1,"-$01$-$02.01$-$02.02$-$02.03$-$03$-$04.01$-$04.02$-$04.03$-$04.04$-$05.01$-$05.02$-$06$-$07.01$-$07.02$-$07.03$-$07.04$-$07.05$-$07.06$-$07.07$-$07.08$-","$"+rec("masotc")+"$")
			if rec("Trangthaiduyet") then
				if  ktmasotc > 0 and isnull(Rec("ngayhtxl")) then
					if Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),4)="1" or Session("ClsFun").LayGiaTriQuyen(Session("Permision"),Session("FormName"),11)="1" or Session("IsAdmin") then
						colorline="blue"
					else
						colorline="grey"
					end if
				else
					colorline="blue"
				end if
			else
				colorline="red"
			end if
%>
	<%if "'" & Rec("ID") & "'"=Request("bID") then
		color="#BDD7D6"
	end if
	%>
	<tr id=mnu_<%=STT%> style="BORDER-RIGHT: #e7e7e7 1px solid; BORDER-TOP: #e7e7e7 1px solid; BORDER-LEFT: #e7e7e7 1px solid; COLOR: #666666; BORDER-BOTTOM: #e7e7e7 1px solid; HEIGHT: 21px; BACKGROUND-COLOR: <%=color%>"  onmouseover="javascript:MouseOverMenu('mnu_<%=STT%>')" onmouseout="javascript:MouseOutMenu('mnu_<%=STT%>','<%=color%>')">
	<%if Request("bfromflow")="ok" then%>
		<%Select case Rec("Tinhchat")
			case "01"%>
				<td width="4%" align="center"><a href='xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>' target="_blank"><p title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thuthuong.gif></p></a></td>
			<%case "02"%>
				<td width="4%" align="center"><a href="xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>" target="_blank"><p title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thukhan.gif></p></a></td>
			<%case "03"%>
				<td width="4%" align="center"><a href="xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>" target="_blank"><p title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thumat.gif></p></a></td>
			<%Case "04"%>
				<td width="4%"><a href="xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>" target="_blank"><p title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thukhanmat.gif></p></a></td>
		<%end select%>	
		<td width="1%" align="center"><a href='xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>' target="_blank"><p title="Xem n&#7897;i dung v&#259;n th&#432;"><%=imagesAttach%></p></a></td>
		
		<td width="10%" align=center><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bfromflow=ok&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>">
		<%=Rec("soghinhan")%></a></td>

		<td width="13%" align="left"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bfromflow=ok&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>">
		<%=Rec("Sogoc")%></a></td>

		<td width="13%" align="center"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bfromflow=ok&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>">
		<%=FormatDate(Rec("ngaynhan"))%></a></td>

		<td width="35%"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bfromflow=ok&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>"><%=Rec("trichyeu")%></a></td>
		
		<td width="25%"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bfromflow=ok&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>"><%=Rec("doitac")%></a></td>
	<%else%>
		<%Select case Rec("Tinhchat")
			case "01"%>
				<td width="4%" ><a href="xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>" target="_blank"><p align="center" title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thuthuong.gif></p></a></td>
			<%case "02"%>
				<td width="4%" ><a href="xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>" target="_blank"><p align="center" title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thukhan.gif></p></a></td>
			<%case "03"%>
				<td width="4%" ><a href="xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>" target="_blank"><p align="center" title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thumat.gif></p></a></td>
			<%Case "04"%>
				<td width="4%" ><a href="xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>" target="_blank"><p align="center" title="Xem n&#7897;i dung v&#259;n th&#432;"><IMG border=0 SRC=Thukhanmat.gif></p></a></td>
		<%end select%>
		<td width="1%" align="center"><a href='xemnoidung.asp?LoaiVt=1&bMa=<%=Rec("ID")%>&bNam=<%=year(Rec("Ngaynhan"))%>' target="_blank"><p title="Xem n&#7897;i dung v&#259;n th&#432;"><%=imagesAttach%></p></a></td>

		<td width="10%" align=center><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>"><%=Rec("Soghinhan")%></a></td>
		<td width="13%"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>"><%=Rec("Sogoc")%></a>
		</td>
		<td width="13%" align="center"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>">
		<%=FormatDate(Rec("ngaynhan"))%></a></td>
		<td width="35%"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>"><%=Rec("trichyeu")%></a></td>
		<td width="25%"><a style='cursor:hand;color:<%=colorline%>;text-decoration: none' href="frmdsVTDen.asp?sort=<%=sort%>&Page=<%=nPage%>&bDisplay=True&bID='<%=Rec("ID")%>'&bNam=<%=year(Rec("Ngaynhan"))%>"><%=Rec("doitac")%></a></td>
	<%end if%>
	</tr> 
		<%
			if  Session("VanBan")="" then
				Session("VanBan")="-" & Rec("ID") 
			else
				Session("VanBan")=Session("VanBan") & "-" & Rec("ID") 
			end if
		%>
<%		STT=STT+1
			Rec.MoveNext
			cnt=cnt+1
			howmanyrecs=howmanyrecs+1
	loop
		Session("VanBan")=Session("VanBan") & "-"
	end if
	rec.Close
	set rec=nothing
%>
    </table>
<!-- Phan trang -->
<br>
<table width="98%" cellspacing=0 cellpadding=0>
<tr>
<% if nPage > 0 and nPageCount >0  then %>  
	<td width="20%"><b>Trang&nbsp; <%=Session("pagevtden")%>/<%=nPageCount%></b></td>
	<td width= "80%" align="right">
	<% if nPageCount > 1 then %>    
		Chuyển nhanh tới trang:&nbsp;
		<select name="page" style="width:45;height: 25;font-size:8pt" size=1 onchange="javaScript:ChangePage()">
			<% for counter = 1 to nPageCount%>	
				<%	if Request("bfromflow")="ok" then
						if bComm<>"search"  then
							strURL= "frmdsvtden.asp?bfromflow=ok&page="+ cstr(counter)+ "&bComm="
						else
							strURL="frmdsvtden.asp?bfromflow=ok&page="+  cstr(counter) + "&bComm=search&TxtSogoc="+bSogoc+"&TxtTungay="+bTungay+"&TxtDenngay="+bdenngay+"&TxtTukhoa="+bTukhoa+"&TxtTrichyeu="+bTrichyeu
						end if
					else
						if bComm<>"search"  then
							strURL= "frmdsvtden.asp?page="+ cstr(counter) + "&bComm="
						else
							strURL= "frmdsvtden.asp?page="+ cstr(counter) + "&bComm=search&TxtSogoc="+bSogoc+"&TxtTungay="+bTungay+"&TxtDenngay="+bdenngay+"&TxtTukhoa="+bTukhoa+"&TxtTrichyeu="+bTrichyeu
						end if
					end if %>
				<option value="<%=strURL%>" <%=chkSelected(counter, Session("pagevtden"))%>><%=counter%></option>
			<% next %>    
		</select>
		</td>                                  
	<% end if %>             
<% 'else %>
<% end if %>
  </tr>
</table>
</form>
</font>
</body>

<%
	Conn.Close
	set Conn=nothing
%>